package pcjavanet.mobilesell.service;

import java.util.List;

import pcjavanet.mobilesell.model.Configuration; 
import pcjavanet.mobilesell.model.PageBean;
import pcjavanet.mobilesell.model.ConfigurationExample;
import pcjavanet.mobilesell.model.QryCondition;
import pcjavanet.mobilesell.model.QryTerm;
import pcjavanet.mobilesell.persistence.ConfigurationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


@Service
public class ConfigurationService {


  @Autowired
  private  ConfigurationMapper configurationMapper;


  public int  insert( Configuration configuration ) throws Exception{
	return configurationMapper.insert (configuration);
  }


  public Configuration  selectByPrimaryKey( Configuration  bean ) {
 	int dbid = bean.getDbid();
	Configuration configuration = configurationMapper.selectByPrimaryKey( dbid );
	return configuration ;
  }


  public int  updateByPrimaryKeySelective( Configuration configuration ) throws Exception{
	return configurationMapper.updateByPrimaryKeySelective( configuration );
  }


  public int  deleteByPrimaryKey( Configuration  bean ) throws Exception{
 	int dbid = bean.getDbid();
	return configurationMapper.deleteByPrimaryKey( dbid );
  }


  public List<Configuration>  selectByExample( Configuration configuration ) throws Exception{
    ConfigurationExample example = new ConfigurationExample();
	return configurationMapper.selectByExample( example );
  }

  public List<Configuration>  getOnePageBeans( QryCondition condition , PageBean pageBean ) throws Exception{
    ConfigurationExample example = new ConfigurationExample();
    ServiceUtil.dealCriteria( condition,  example.createCriteria() );
	List<Configuration> ls=configurationMapper.getOnePageBeans( example , pageBean );
//begin
	if ( ls.size() > 0 ) {
	}
//end
	return ls;
  }

  public int getTotalRecords( QryCondition condition , PageBean pageBean ) throws Exception{
    ConfigurationExample example = new ConfigurationExample();
    ServiceUtil.dealCriteria( condition,  example.createCriteria() );
	return configurationMapper.getTotalRecords( example , pageBean );
  }

  public int countByExample( Configuration configuration , PageBean pageBean ){
    ConfigurationExample example = new ConfigurationExample();
	return configurationMapper.countByExample( example );
  }
  public List<Configuration> selectByExamplePage( Configuration configuration , PageBean pageBean ){
  ConfigurationExample example = new ConfigurationExample();
	return configurationMapper.selectByExamplePage( example , pageBean );
  }

}
